// app/blog/[slug]/page.tsx import { format, parseISO } from 'date-fns' import { allPosts } from 'contentlayer/generated' import { MDXContent } from '@/components/mdx-content' export const generateStaticParams = async () => allPosts.map((post) => ({ slug: post._raw.flattenedPath })) export const generateMetadata = async ({ params }: { params: Promise<{ slug: string }> }) => { const { slug } = await params const post = allPosts.find((post) => post._raw.flattenedPath === slug) if (!post) throw new Error(`Post not found for slug: ${slug}`) return { title: post.title } } const PostLayout = async ({ params }: { params: Promise<{ slug: string }> }) => { const { slug } = await params const post = allPosts.find((post) => post._raw.flattenedPath === slug) if (!post) throw new Error(`Post not found for slug: ${slug}`) return (

{post.title}

) } export default PostLayout